import httpUtil from "../utils/httpUtil"
import messageUtil from "../utils/messageUtil"
import logApi from "./logApi"
import paramApi from "./paramApi"
import userApi from "./userApi"
import zfbMiniPayApi from "./zfbMiniPayApi"

/**
 * 
 */
const submitOrder = (params, successCallBack, errorCallBack) => {

	messageUtil.showLoading()
	logApi.addXiaoWuGushiLog('请求前，参数：' + JSON.stringify(params))
	httpUtil.post('/api/shengxin/submitOrder', params, res => {
		messageUtil.closeLoading()
		logApi.addXiaoWuGushiLog('请求成功，请求参数：' + JSON.stringify(params) + '，返回信息：' + JSON.stringify(
			res))
		console.log('submitOrder：' + JSON.stringify(res))
		successCallBack(res)

	}, err => {
		logApi.addXiaoWuGushiLog('请求发生错误，请求参数：' + JSON.stringify(params) + '，返回信息：' + JSON
			.stringify(
				err))
		if (errorCallBack) {
			errorCallBack(err)
		}
	})
}

export default {
	submitOrder,
}